package homework1;

public class PollyQuestion {

	// Q: what's the smallest whole number that satisfies all of the following: 
	// (a) dividing by 7 gives a remainder of 4, 
	// (b) dividing by 8 gives a remainder of 5, 
	// (c) dividing by 9 gives a remainder of 6.
	
	public static void main(String args[]){
		
		for (long i = 1 ; i <=9999 ; i++){
		
			if (i%7 == 4 && i%8==5 && i%9==6){
				System.out.println(i);
				break;
			}
		}		
	}
}


